import request from "@/utils/request";
import { download, downloadOfGet } from "@/utils/request";
import dayjs from "dayjs";
// 加载关键设备
export function getDeviceInfoList(params) {
  return request({
    url: "/health/cruxDevice/findCrudDeviceList",
    method: "get",
    params,
  });
}
// 一层决断
export function primaryLogic(id) {
  return request({
    url: "/guard/primaryLogic/" + id,
    method: "get",
  });
}

// 二层决断
export function minorLogic(id) {
  return request({
    url: "/guard/minorLogic/" + id,
    method: "get",
  });
}

// 生成
export function addBatch(data) {
  return request({
    url: "/guard/maintainWork/addBatch",
    method: "post",
    data,
  });
}

// 导出
export function exportExcel(fileName, params) {
  return downloadOfGet(
    "/guard/maintainWork/export",
    `维修工单${dayjs().format("YYYY-MM-DD HH_mm_ss")}.xlsx`,
    params
  );
}
